import { getAxios,postAxios,putAxios,deleteAxios } from './request'

/**
 * 查询书籍列表
 * @returns Promise<Array> 书籍列表 
 */
export const getBookList = () => {
  return getAxios("/book/get/list");
}

/**
 * 根据条件查询书籍列表
 * @param { {bookName,detail} } bookDto 
 * @returns 
 */
export const postBookList = (bookDto) => {
  return postAxios("/book/post/list", bookDto);
}


/**
 * 更新书籍信息
 * @param { {bookID,bookName,bookCounts,detail} } bookDto 
 * @returns 
 */
export const updateBook = (bookDto)=>{
  return putAxios("/book/update/book",bookDto);
}

/**
 * 删除书籍
 * @param { Number } bookID 
 * @returns 
 */
export const deleteBook = (bookID)=>{
  return deleteAxios("/book/delete/book",bookID);
}